<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="./jquery.js"></script>
    <script type="text/javascript" src="./stickytooltip.js"></script>
    <link href="stickytooltip.css" rel="stylesheet" type="text/css">
<title>Công nghệ Web & Ứng dụng</title>
</head>
<?php 
    require_once("mysql.php");
    require_once("function.php");
    if(isset($_GET['idSP']))
        $idSP = $_GET['idSP'];
   
    $sp =  Sanpham();
    $sp1 = Sanpham();
   $sp_moi = SanphamMoi(3,0);
   $sp_moi2 = SanphamMoi(3,0);
   $sp_caocap = SanphamCC(3, 20000001, 2000000000);
   $sp_caocap2 = SanphamCC(3, 20000001, 2000000000);
   $sp_trungcap = SanphamTC(3, 2000001, 20000000);
   $sp_trungcap2 = SanphamTC(3, 2000001, 20000000);
   $sp_phothong = SanphamPT(3, 2000000);
   $sp_phothong2= SanphamPT(3, 2000000);
   
   
   
   
?>

<table align="center">
<tr> 
 <h2><a href="Sanpham_moi.php">Sản Phẩm Mới</a></h2>
    <table border=".5" style="width: 87%">
    <?php
        $stt=0;
		$tooltipsData = "";
        while($rows_moi = mysql_fetch_array($sp_moi))
        {
            if($rows_moi['New']==0)
            {
        ?>
            <td style="width: 29%" align="center">
                <?php echo $rows_moi['TenSP']?><br/>
                <a href="Chitietsanpham.php?page=chitietdtdd&idSP=<?=$rows_moi['idSP'] ?>" data-tooltip="sticky<?=$rows_moi['idSP']?>">
                <img src="upload/sanpham/hinhchinh/<?php echo $rows_moi['UrlHinh']?>" width="100" height="100" align="center"></a>
                <img src="img/new.gif" width="29" height="19" align="top"><br/>
                <span type="text"><?php echo number_format($rows_moi['Gia'],2)?></span>VNĐ<br/>
            </td>
        <?php
			$tooltipsData .= '
				<div id="sticky'.$rows_moi["idSP"].'" class="atip" style="width: 200px">  
                                '.$rows_moi["TenSP"].'<br/>
                                    <img src="upload/sanpham/hinhchinh/'.$rows_moi["UrlHinh"].'"><br/>';
			if($rows_moi["New"]==0)
				$tooltipsData .= '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
			$tooltipsData .= '<span type="text">'.number_format($rows_moi["Gia"],2).'</span>VNĐ<br/></div>';
			}
			else echo "";
		}
		?>
    </table>
 </tr>
 <tr>
   <h2><a href="Sanpham_caocap.php">Cao Cấp</h2>
   <table border=".5" style="width:87%">
	<?php 
		$stt=0;
        while($rows_caocap = mysql_fetch_array($sp_caocap))
        {
	?>
       <td style="width:29%" align="center">
            <?php echo $rows_caocap['TenSP']?><br/>
            <a href="Chitietsanpham.php?page=chitietdtdd&idSP=<?=$rows_caocap['idSP']?>" data-tooltip="sticky<?=$rows_caocap['idSP']?>">
            <img  src="upload/sanpham/hinhchinh/<?php echo $rows_caocap['UrlHinh']?>" width="100" height="100" align="center"></a><br/>
            <?php
                if($rows_caocap['New']==0)
                    echo '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
            ?>

            <span type="text"><?php echo number_format($rows_caocap['Gia'],2)?></span>VNĐ<br/>
       </td>      
	<?php
		$tooltipsData .= '
				<div id="sticky'.$rows_caocap["idSP"].'" class="atip" style="width: 200px">  
                                '.$rows_caocap["TenSP"].'<br/>
                                    <img src="upload/sanpham/hinhchinh/'.$rows_caocap["UrlHinh"].'"><br/>';
			if($rows_caocap["New"]==0)
				$tooltipsData .= '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
			$tooltipsData .= '<span type="text">'.number_format($rows_caocap["Gia"],2).'</span>VNĐ<br/></div>';
		}
	?>
   </table>
 </tr>
  </tr>
   <tr>
   <h2><a href="Sanpham_trungcap.php">Trung Cấp</a></h2>
   <table border=".5" style="width:87%">
     <?php 
        while($rows_trungcap = mysql_fetch_array($sp_trungcap))
        { ?>
      <td style="width:29%" align="center">
            <?php echo $rows_trungcap['TenSP']?><br/>
            <a href="Chitietsanpham.php?page=chitietdtdd&idSP=<?php echo $rows_trungcap['idSP']?>" data-tooltip="sticky<?= $rows_trungcap['idSP']?>">
            <img  src="upload/sanpham/hinhchinh/<?php echo $rows_trungcap['UrlHinh']?>" width="100" height="100" align="center"></a><br/>
            <?php
                if($rows_trungcap['New']==0)
                    echo '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
            ?>
            <span type="text"><?php echo number_format($rows_trungcap['Gia'],2)?></span>VNĐ<br/>
       </td>
	   <?php
		$tooltipsData .= '
				<div id="sticky'.$rows_trungcap["idSP"].'" class="atip" style="width: 200px">  
                                '.$rows_trungcap["TenSP"].'<br/>
                                    <img src="upload/sanpham/hinhchinh/'.$rows_trungcap["UrlHinh"].'"><br/>';
			if($rows_trungcap["New"]==0)
				$tooltipsData .= '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
			$tooltipsData .= '<span type="text">'.number_format($rows_trungcap["Gia"],2).'</span>VNĐ<br/></div>';
		?>
      <?php }?>
   </table>
  
    

  </tr>
  <tr>
   <h2><a href="Sanpham_phothong.php">Phổ Thông</h2>
   <table border=".5" style="width:87%">
     <?php 
        while($rows_phothong = mysql_fetch_array($sp_phothong))
     { ?>
       <td style="width: 29%" align="center" >
            <?php echo $rows_phothong['TenSP']?><br/>
            <a href="Chitietsanpham.php?page=chitietdtdd&idSP=<?php echo $rows_phothong['idSP']?>" data-tooltip="sticky<?php echo $rows_phothong['idSP']?>">
            <img  src="upload/sanpham/hinhchinh/<?php echo $rows_phothong['UrlHinh']?>" width="100" height="100" align="center"></a><br/>
            <?php
                if($rows_phothong['New']==0)
                    echo '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
            ?>
            <span type="text"><?php echo number_format($rows_phothong['Gia'],2)?></span>VNĐ<br/>
       </td>
         
		<?php
		$tooltipsData .= '
				<div id="sticky'.$rows_phothong["idSP"].'" class="atip" style="width: 200px">  
                                '.$rows_phothong["TenSP"].'<br/>
                                    <img src="upload/sanpham/hinhchinh/'.$rows_phothong["UrlHinh"].'"><br/>';
			if($rows_phothong["New"]==0)
				$tooltipsData .= '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
			$tooltipsData .= '<span type="text">'.number_format($rows_phothong["Gia"],2).'</span>VNĐ<br/></div>';
		?>
      <?php }?>
   </table>
   
   
  </tr>
</table>



		<div id="mystickytooltip" class="stickytooltip">
			<div style="padding: 5px">
				<?=$tooltipsData;?>
			</div>
		</div>
</html>
